<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <link rel="stylesheet" type="text/css" href="<?php echo $base_url ;?>css/style2.css" />
        
        <title>My accounts list</title>
		
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/1.8.3/ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>js/jquery.blockUI.js"></script>
<script language="javascript">
		$.noConflict();
		var __base_url   = '<?=base_url()?>';
		var __csrf       = '<?=$this->security->get_csrf_hash();?>';
		var __ts		 = <?php echo time(); ?>;
</script>
<style type="text/css"></style>

		
</head>
	<body>
        <div id="notification_message">
        	<div id="notification_close"><a href="/settings/notification_close?msg=">X</a></div>
        	<div id="notification_body"></div>

        </div>
		<noscript>
			<style type="text/css">
				#menu .item {background: #ffffff url(images/mainmenu_active_bg.png) repeat-x top;} 
				#menu .item .level2{display: block;}
			</style>
		</noscript>
		<table width="966" cellpadding="0" cellspacing="0" border="0" align="center">
			<tr>
				<td>
					<div id="header">
						<div class="h_item logo">
							<a href="<?php echo $base_url ;?>account/home/">
								<img src="<?php echo $base_url ;?>images/logo.png" alt="" />
							</a>
						</div>
						
						<div id="topMenu">
	                        
	                        
						</div>
					</div>
					<div id="middle">
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
							<tr valign="top">
								
								<td width="200">

									<div id="leftColumn">
										<div id="menu">
				                    				
													
						<div class="item">
		<a href="#" class="label">Deposit funds</a>
		<div class="level2">
			<a href="<?php echo $base_url ;?>account/deposit_cc/"><span>Debit / Credit Card</span><img src="<?php echo $base_url ;?>images/ps_mastercard.png" /><img src="<?php echo $base_url ;?>images/ps_visa.png" /></a>
			<a href="<?php echo $base_url ;?>account/deposit_lr/"><span>Liberty Reserve</span><img src="<?php echo $base_url ;?>images/ps_20_LR.png" /></a>
			<a href="<?php echo $base_url ;?>account/deposit_wire/"><span>Wire transfer</span></a>
			<a href="<?php echo $base_url ;?>account/deposit_mb/"><span>Moneybookers</span><img src="<?php echo $base_url ;?>images/ps_20_MB.png" /></a>
		</div>
	</div>
	<div class="item">
		<a href="<?php echo $base_url ;?>account/withdrawal" class="label">Withdraw funds</a>
		<div class="level2">
			<a href="<?php echo $base_url ;?>account/withdraw_lr/"><span>Liberty Reserve</span><img src="<?php echo $base_url ;?>images/ps_20_LR.png" /></a>
			<a href="<?php echo $base_url ;?>account/withdraw_wire/"><span>Wire transfer</span></a>
			<a href="<?php echo $base_url ;?>account/withdraw_mb/"><span>Moneybookers</span><img src="<?php echo $base_url ;?>images/ps_20_MB.png" /></a>
			<a href="<?php echo $base_url ;?>account/withdraw_internal/"><span>Internal transfer</span><img src="<?php echo $base_url ;?>images/ps_20_IN.png" /></a>

		</div>
	</div>
	<div class="item active">
		<a href="#" class="label">My accounts</a>
		<div class="level2">
			<a href="<?php echo $base_url ;?>account/accts_list/"><span>My accounts list</span></a>
			<a target="_blank" href="<?php echo $base_url ;?>users/register_live"><span>Open account</span></a>
			<a target="_blank" href="<?php echo $base_url ;?>users/register_demo"><span>Open demo account</span></a>
			<a target=_blank href="http://www.golderforex.com/GM-MT4-Client.exe"><span>Download MT4 Platform</span></a>		
			<a target=_blank href="http://platform.tradency.com/b71/GolderMarkets/"><span>Login Mirror Trader</span></a>		
		</div>
	</div>
	<?php if(!$this->session->userdata('mirror')){ ?>
	<div class="item">
		<a href="#" class="label">Security</a>
		<div class="level2">
			<a href="<?php echo $base_url ;?>account/password_center">Passwords Wizard</a>
			<!--<a href="<?php echo $base_url ;?>account/logs">Logs</a>-->
		</div>
	</div>
	<?php } ?>
	<?php if($this->session->userdata('ib')){ ?>
	<div class="item">
		<a href="#" class="label">Affiliate</a>
		<div class="level2">
			<a href="<?php echo $base_url ;?>account/afflink/">Get referral link</a>
			<a href="<?php echo $base_url ;?>account/affclients/">Manage my clients</a>
			<a href="<?php echo $base_url ;?>account/subib_recruit_link/">Sub-IB Recruitment Link</a>
		</div>
	</div>
	<?php } ?>

	<!-- <div class="item">
		<a href="/help" class="label">Help</a>
	</div> -->
	<div class="item">
		<a href="<?=$base_url?>sessions/logout" class="label" onclick="return confirm('Are you sure that you want to logout?');">Logout</a>
	</div>
	
	
	
	
	                    
						            </div>
										
										<br />
					                    <table border="0" cellpadding="0" cellspacing="0" align="center">
					                    	<tr>

					                    		<td>
	</td>
					                    	</tr>
					                    </table>

									</div>
								</td>
								<td style="width: 15px;">&nbsp;</td>
		                    	
								<td id="content">
			                        
<h1>My accounts list</h1>

<?php
		$tpl_page 	= new Tpl_page(); $tpl_page->where('type','account_mya_list')->get(1);
		if($tpl_page->exists()) echo str_replace(array('&lt;','&gt;'),array('<','>'),$tpl_page->content);
?>

<p>
<table class="">
    <thead>
    <tr>
        <th>Platform</th>
		<th>Type</th>
		<th>Account</th>
    </tr>
    </thead>
    <tbody>
	<?php 
			$mt4_accts = new User();
			$mt4_accts->where('email',$user->email)->where('mt4_group NOT IN',"('GM-AUTO','GM-AUTO2','GM-AUTO3')", FALSE)->get();
			
			$mirror_accts = new User();
			$mirror_accts->where('email',$user->email)->where('mt4_group IN',"('GM-AUTO','GM-AUTO2','GM-AUTO3')", FALSE)->get();
	?>
	<?php
			foreach($mt4_accts as $acct){ 
	?>
    <tr>
		<td>MT4</td>
        <td><?php echo (strtolower($acct->type)=='real'?'Live':ucfirst($acct->type)); ?></td>
        <td><?php echo $acct->mt4_uid; ?></td>
    </tr>
    <?php 	} ?>
	<?php
			foreach($mirror_accts as $acct){ 
	?>
    <tr>
		<td>Mirror</td>
        <td>Live</td>
        <td><?php echo $acct->mirror_login_id?$acct->mirror_login_id:'N/A'; ?></td>
    </tr>
    <?php 	} ?>
	
	<?php
			if($mt4_accts->result_count()==0 && $mirror_accts->result_count()==0)
			{
	?>
	<tr><td colspan="3">No records found.</td></tr>
	<?php
			}
	?>
    </tbody>
</table>
	


								</td>
							</tr>
						</table>
					</div>
					<?php
						$tpl_page 	= new Tpl_page(); $tpl_page->where('type','footer')->get(1);
						if($tpl_page->exists()) echo $tpl_page->content;
					?>
				</td>
			</tr>
		</table>
		
		<script language="">
				jQuery(document).ready(function(){
						jQuery('a.label').click(function(event){
								if(jQuery(this).attr('href')=='#')
								{
										event.preventDefault();
										if(jQuery(this).parent().is('.active'))
										{
												jQuery(this).parent().removeClass('active','slow');
										}
										else
										{
												jQuery(this).parent().addClass('active','slow');
										}
								}
						});
				});
		</script>
		
	</body>
</html>
